package io.modules.test.service.impl;

import io.modules.test.dao.EmpDao;
import io.modules.test.entity.EmpEntity;
import io.modules.test.service.EmpService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.common.utils.PageUtils;
import io.common.utils.Query;


@Service("empService")
public class EmpServiceImpl extends ServiceImpl<EmpDao, EmpEntity> implements EmpService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String  key = (String) params.get("key");
        IPage<EmpEntity> page = this.page(
                new Query<EmpEntity>().getPage(params),
                new QueryWrapper<EmpEntity>().like("name",key)
        );

        return new PageUtils(page);
    }

}